import java.util.Scanner;
public class Main2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [] arr =new int[n];
        int change1 = 0;
        int change2 = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }
        int a[] = new int[n+1];
        for(int id:arr){
           a[id]++;
        }
        for(int count:a){
            if(count>2){
                change2+=count-2;
            }
            if (count==1){
                change1++;
            }
        }
        System.out.println(change2>change1?change2:change2+(change1-change2)/2);
        scan.close();

    }
}
